package com.tencent.ied.bk.handler.impl;

import cn.hutool.core.util.ArrayUtil;
import com.tencent.ied.bk.constant.CommonConstant;
import com.tencent.ied.bk.entity.BaseAbstractInfo;
import com.tencent.ied.bk.handler.Handler;
import com.tencent.ied.bk.handler.HandlerObject;

/**
 * @author chen_yu
 * @date 2021/3/11 7:08
 */
public class PrintHandler implements Handler {
    @Override
    public void handle(HandlerObject handlerObject) {
        Object[] objects = handlerObject.getSearchAbstractInfoList().stream().map(BaseAbstractInfo::getContent).toArray();
        String join = ArrayUtil.join(objects, CommonConstant.SPLITOR);
        handlerObject.setResult(join);
        System.out.println(join);
        System.out.println("============================================================================");
    }
}
